
Page({
    onInit(param) {
        getApp()._options.globalData._err_msg = param
    },

    build() {
        let alarm_id = hmFS.SysProGetInt('__TIMER_ALARM_ID__')
        if (typeof(alarm_id) != 'undefined') {
            hmApp.alarmCancel(alarm_id)
        }

        hmUI.createWidget(hmUI.widget.TEXT, {
            x: 0,
            y: 50,
            w: 192,
            h: 30,
            color: 0xff0000,
            text_size: 20,
            align_h: hmUI.align.CENTER_H,
            align_v: hmUI.align.CENTER_V,
            text_style: hmUI.text_style.NONE,
            text: 'Panic'
        })

        hmUI.createWidget(hmUI.widget.TEXT, {
            x: 0,
            y: 100,
            w: 192,
            h: 30,
            color: 0xffffff,
            text_size: 20,
            align_h: hmUI.align.CENTER_H,
            align_v: hmUI.align.CENTER_V,
            text_style: hmUI.text_style.NONE,
            text: getApp()._options.globalData._err_msg
        })

        hmUI.createWidget(hmUI.widget.BUTTON, {
            x: 0,
            y: 300,
            text: 'Exit',
            w: 192,
            h: 50,
            click_func: () => {
              hmApp.gotoHome()
            }
          })
    }
})
